#ifndef TRANSACTIONMODEL_H
#define TRANSACTIONMODEL_H

#include <QSqlRelationalTableModel>

class TransactionModel : public QSqlRelationalTableModel
{
	Q_OBJECT

public:
	TransactionModel(QObject* parent);

	void addTransaction(int);
	void addTransaction(int, double, uint, const QString&, const QString&);
	void addNDTransactions(const QList<QStringList>&, int, int);
	void deleteTransactions(const QModelIndexList&);

	bool isNDAccount(int);

private:
	void updateAccountBalance(int);

private slots:
	void slot_dataChanged(const QModelIndex&, const QModelIndex&);
	void slot_rowsInsertedOrRemoved(const QModelIndex&, int, int);
};

#endif // TRANSACTIONMODEL_H
